﻿using System;

class LastDigitToWord

            // Write a method that returns the last digit of given integer as an English word. Examples: 512  "two", 1024  "four", 12309  "nine".
{
    static void Main()
    {
        Console.Write("Enter an integer: ");
        int number = int.Parse(Console.ReadLine());
        Console.WriteLine();
        ConvertDigit(number); 
    }

    static int ConvertDigit(int number)
    {
        int result = number % 10;
        switch (result)
        {
            case 0: Console.WriteLine("The last digit is 0 - zero");
                break;
            case 1: Console.WriteLine("The last digit is 1 - one");
                break;
            case 2: Console.WriteLine("The last digit is 2 - two");
                break;
            case 3: Console.WriteLine("The last digit is 3 - three");
                break;
            case 4: Console.WriteLine("The last digit is 4 - four");
                break;
            case 5: Console.WriteLine("The last digit is 5 - five");
                break;
            case 6: Console.WriteLine("The last digit is 6 - six");
                break;
            case 7: Console.WriteLine("The last digit is 7 - seven");
                break;
            case 8: Console.WriteLine("The last digit is 8 - eight");
                break;
            case 9: Console.WriteLine("The last digit is 9 - nine");
                break;
            default: Console.WriteLine("Invalid input!");
                break;
        }
        return result;
    }
}

